package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.anno.RpcDIService;
import com.lagou.rpc.pojo.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ClientController {

    @RpcDIService
    IUserService iUserService;

    @RequestMapping("/demo")
    public String demo(int id) {

        User user = iUserService.getById(id);

        return user.toString();
    }
}
